import axios from '@/utils/axios.js'

/*
 * 任务管理模块
 */

// 新增任务
export const addJob = (data) => {
    return axios({
        url: 'job/job/addJob.json',
        method: 'post',
        data
    })
}
// 编辑任务
export const editJob = (data) => {
    return axios({
        url: 'job/job/updateJob.json',
        method: 'post',
        data
    })
}
// 删除任务
export const deleteJob = (params) => {
    return axios({
        url: 'job/job/delJob.json',
        method: 'post',
        params
    })
}

//分页获取任务tableList列表
export const getJobsList = (params) => {
    return axios({
        url: 'job/job/getJobs.json',
        method: 'get',
        params
    })
}

/*
 * 触发器管理模块
 */

// 新增触发器
export const addTrigger = (data) => {
    return axios({
        url: 'job/trigger/addTrigger.json',
        method: 'post',
        data
    })
}
// 编辑触发器
export const editTrigger = (data) => {
    return axios({
        url: 'job/trigger/updateTrigger.json',
        method: 'post',
        data
    })
}
// 删除触发器
export const deleteTrigger = (params) => {
    return axios({
        url: 'job/trigger/delTrigger.json',
        method: 'post',
        params
    })
}

//分页获取任务tableList列表
export const getTriggersList = (params) => {
    return axios({
        url: 'job/trigger/getTriggers.json',
        method: 'get',
        params
    })
}
